placessidebar {
  .navigation-sidebar > row {
    // Needs overriding of the `.navigation-sidebar > row` padding
    padding: 0;

    // Using margins/padding directly in the SidebarRow
    // will make the animation of the new bookmark row jump
    > revealer { padding: 0 $base_padding * 2 + 2px; }

    image.sidebar-icon {
      &:dir(ltr) { padding-right: $base_padding + 2px; }
      &:dir(rtl) { padding-left: $base_padding + 2px; }
    }

    label.sidebar-label {
      &:dir(ltr) { padding-right: 2px; }
      &:dir(rtl) { padding-left: 2px; }
    }

    @at-root button.sidebar-button {
      @extend %button_basic_flat;

      min-height: 26px;
      min-width: 26px;
      margin-top: $base_padding / 2;
      margin-bottom: $base_padding / 2;
      padding: 0;
      border-radius: 100%;
    }

    // in the sidebar case it makes no sense to click the selected row
    &:selected:active { box-shadow: none; }

    &.sidebar-placeholder-row {
      padding: 0 $base_padding + 2px;
      min-height: 2px;
      background-image: image($drop_target_color);
      background-clip: content-box;
    }

    &.sidebar-new-bookmark-row { color: $accent_color; }

    &:drop(active):not(:disabled) {
      color: $drop_target_color;
      box-shadow: inset 0 0 0 1px $drop_target_color;
    }
  }
}

row {
  image.sidebar-icon {
    opacity: 0.7; // see bug #786613 for details on this oddity
  }

  .sidebar-button {
    opacity: 0.7;

    &:hover,
    &:active,
    &.keyboard-activating {
      opacity: 1;
    }
  }
}

placesview {
  .server-list-button > image {
    transition: -gtk-icon-transform 200ms $ease-out-quad;
    -gtk-icon-transform: rotate(0turn);
  }

  .server-list-button:checked > image {
    -gtk-icon-transform: rotate(-0.5turn);
  }

  > actionbar > revealer > box > box {
    border-spacing: $base_padding;
  }
}

filechooser {
  box-shadow: 0 1px $border_color;

  #pathbarbox {
    border-bottom: 1px solid $border_color;
  }

  // Make the toolbar buttons flat like on an actual toolbar
  #pathbarbox > stack > box > {
    button,
    box > button,
    menubutton > button {
      @extend %button_basic_flat;
    }
  }

  pathbar button {
    &:not(.image-button) {
      padding-left: $base_padding * 1.5;
      padding-right: $base_padding * 1.5;
    }

    // Icon + label buttons
    > box {
      border-spacing: $base_margin;

      > label {
        padding-left: 2px;
        padding-right: 2px;
      }
    }
  }

  columnview > listview > row > cell {
    padding: 0;

    > filelistcell {
      padding: 8px $base_padding;
    }
  }

  gridview {
    @include undershoot(top, $shade_color, true);
    padding: $base_padding * 2.5;

    > child {
      border-radius: $card_radius;
      padding: 0;
      margin: $base_padding / 2;

      > filelistcell {
        padding: $base_padding $base_padding * 2;
      }

      & filethumbnail image {
        filter: drop-shadow(0px 1px 1px rgba(0,0,0,0.3));
      }

      & box {
        border-spacing: $base_padding;
      }
    }
  }

  // Style the outer action bar with a toolbar view-like shadow
  > box > actionbar {
    box-shadow: 0 -1px $border_color;

    > revealer > box {
      box-shadow: none;
      padding-top: $base_padding;
    }
  }

  // Style the remote search action bar like a banner
  scrolledwindow + actionbar > revealer > box {
    background-color: gtkmix($accent_bg_color, $view_bg_color, 30%);
    color: $window_fg_color;
    box-shadow: none;
    padding-top: $base_padding;
    font-weight: bold;

    &:backdrop {
      background-color: gtkmix($accent_bg_color, $view_bg_color, 15%);
    }
  }

  placesview {
    // Only the bottom undershoot, since the action bar is guaranteed to be
    // there, while the search bar can show and hide. That's a problem, since
    // we only need top undershoot when it's visible, to avoid a double shadow.
    > stack > scrolledwindow {
      @include undershoot(bottom);
    }

    // Make the Connect to Server action bar flat
    > actionbar > revealer > box {
      background: $view_bg_color;
      color: $view_fg_color;
      box-shadow: none;
      padding-top: $base_padding;

      &:backdrop {
        background: $view_bg_color;
        transition: none;
      }
    }
  }

  placessidebar {
    background-color: $sidebar_bg_color;
    color: $sidebar_fg_color;

    &:backdrop {
      background-color: $sidebar_backdrop_color;
      transition: background-color $backdrop_transition;
    }
  }

  // The separator is a part of GtkPaned, so it needs to be styled separately
  paned.horizontal > separator {
    &:dir(ltr) {
      box-shadow: inset 1px 0 $sidebar_bg_color,
                  inset 1px 0 $border_color;

      &:backdrop {
        box-shadow: inset 1px 0 $sidebar_backdrop_color,
                    inset 1px 0 $border_color;
      }
    }

    &:dir(rtl) {
      box-shadow: inset -1px 0 $sidebar_bg_color,
                  inset -1px 0 $border_color;

      &:backdrop {
        box-shadow: inset -1px 0 $sidebar_backdrop_color,
                    inset -1px 0 $border_color;
      }
    }

    &:backdrop {
      transition: box-shadow $backdrop_transition;
    }
  }
}

/* Fix header bar height in the file chooser */
window.filechooser headerbar box.start + box.vertical {
  margin-top: -$base_padding;
  margin-bottom: -$base_padding;
  min-height: 12px;
}


.fr-sidebar {
  > row {
    padding: $base_padding $base_padding * 1.5;

    &:not(.fr-sidebar-row) {
      &, &:hover, &:active, &:focus, &:selected,
      &:active:hover, &:focus:hover, &:selected:hover {
        background: none;
        animation: none;
        transition: none;
      }
    }
  }
}